package com.websocket.controller;

import com.websocket.domain.WiselyMessage;
import com.websocket.domain.WiselyResponse;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

@Controller
public class WsController {
	@MessageMapping("welcome")
	@SendTo("/topic/getResponse")
	public WiselyResponse say(WiselyMessage msg) throws Exception {
		Thread.sleep(1000);
		return new WiselyResponse("welcome,this is:" + msg.getName() + "!");
	}
}
